<?php if (count($this->v('data'))>0):?>
	<div <?php 
		if (is_array($this->v('options')) && count($this->v('options'))>0)
		{
			foreach ($this->v('options') AS $key=>$value)
			{
				print $key.'="'.($key == 'class'?('projects '.$value):$value).'" ';
			}
		}?>>
	<?php 
		foreach ($this->v('data') AS $project):
		$image = (false !== $project[$this->v('size')])?$project[$this->v('size')][0]:null;
		$full = (false !== $project['large'])?$project['large'][0]:null;
	?>
		<div class="p <?php print $this->v('size');?>">
			<div class="rim transition">
				<a href="<?php print $this->v('imageLink')?$project['url']:$full;?>" <?php if(!$this->v('imageLink')):?>rel="lightbox"<?php endif;?> class="lightbox" title="<?php print $project['title'];?>">
					<span class="hover"></span>
					<img src="<?php print $image;?>" rel="<?php print $project['id'];?>"/>
				</a>
			</div>
			<?php if ($this->v('title')):?>
				<a href="<?php print $project['url'];?>">
				<h2><?php print $project['title'];?></h2>
				</a>
			<?php endif;?>
		</div>
	<?php endforeach;?>
	</div>
<?php endif;?>